package com.example.edwincompose.ui

import androidx.compose.runtime.Composable
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import com.example.edwincompose.feature.main.mainScreent
import com.example.edwincompose.feature.main.navigateToMain
import com.example.edwincompose.feature.splash.SPLASH_ROUTE
import com.example.edwincompose.feature.splash.splashScreent

@Composable
fun MyApp(navController: NavHostController) {
    //这是一个容器。用于更换不同的页面
    NavHost(navController = navController, startDestination = SPLASH_ROUTE){//startDestination默认启动的界面
        //所有的界面都在这里。 但我们不直接写在这里，因为不好管理
        splashScreent(navController::navigateToMain)
        mainScreent()
    }
}